package com.ebelter.btcomlib.models.bluetooth.products.bpm;


import com.ebelter.btcomlib.models.bluetooth.bean.SendMessage;

import java.util.Calendar;

//血压计的制包工具类
public class BPMBytesMake {


    private static final String SYS_TIME="同步时间";


    //同步时间
    public static SendMessage sys_time(){

        //设备连接成功后，发送时间信息到设备
        Calendar cale = Calendar.getInstance();
        byte year = (byte)(cale.get(Calendar.YEAR) % 100);
        byte month = (byte)(cale.get(Calendar.MONTH) + 1);
        byte date = (byte)cale.get(Calendar.DATE);
        byte hour = (byte)cale.get(Calendar.HOUR_OF_DAY);
        byte mil = (byte)cale.get(Calendar.MINUTE);
        byte seconds = (byte)cale.get(Calendar.SECOND);
        byte[] setTimeBytes = {(byte)0xff, (byte)0xfd, 0x01, year, month, date, hour, mil, seconds};

        SendMessage heartMsg=new SendMessage();
        heartMsg.datas=setTimeBytes;
        heartMsg.desc=SYS_TIME;
        return heartMsg;
    }


}
